package com.company.action;

import org.apache.struts2.ServletActionContext;

import com.company.entity.Guanjianci;
import com.company.service.GuanjianciService;

public class GuanjianciAction extends BaseAction {

	private Guanjianci guanjianci;
	private GuanjianciService guanjianciService;
	
	public Guanjianci getGuanjianci() {
		return guanjianci;
	}

	public void setGuanjianci(Guanjianci guanjianci) {
		this.guanjianci = guanjianci;
	}

	public GuanjianciService getGuanjianciService() {
		return guanjianciService;
	}

	public void setGuanjianciService(GuanjianciService guanjianciService) {
		this.guanjianciService = guanjianciService;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		ServletActionContext.getRequest().getSession().setAttribute("guanjianci",guanjianciService.query());
		return super.execute();
	}
	

	public void list() {
		ServletActionContext.getRequest().getSession().setAttribute("guanjianci",guanjianciService.query());
	}
	
	public String update() {
		guanjianci.setId(1);
		guanjianciService.update(guanjianci);
		list();
		return SUCCESS;
	}

}
